<template>
  <div>
    <div v-if="data && data.length" class="medium-data-case-list">
      <div v-for="(i, index) in data" :key="index" class="medium-data-case">
        <span class="case-dot"><i/></span>
        <el-tooltip v-if="i.company && i.company.length > 20" placement="top" effect="dark">
          <div slot="content" style="max-width: 300px;">{{ i.company }}</div>
          <span class="company">{{ i.company.substr(0, 20) }}...</span>
        </el-tooltip>
        <span v-else class="company">{{ i.company || '--' }}</span>
      </div>
    </div>
    <div v-else>--</div>
  </div>
</template>

<script>
import { TableData } from '@/views/medium/mixin/mediumData';
import { numFormat } from '@/filters/number';
export default {
  filters: { numFormat },
  props: {
    activeTabs: {
      type: String,
      default: ''
    },
    data: {
      type: Object | Array,
      default: () => {
        return {};
      }
    }
  },
  data() {
    return {
      TableData
    };
  }
};
</script>
<style lang="scss" scoped>
.medium-data-case {
  .case-dot {
    width: 8px;
    height: 8px;
    border-radius: 100%;
    background-color: rgba(64,110,255,0.3);;
    display: inline-block;
    margin-right: 5px;
    position: relative;
    i {
      position: absolute;
      left: 50%;
      top: 50%;
      margin-left: -2px;
      margin-top: -2px;
      width: 4px;
      height: 4px;
      border-radius: 100%;
      display: inline-block;
      background-color: #406EFF;
    }
  }
  .company {
    color: #333333;
    font-size: 12px;
    word-break: break-all;
  }
}
</style>
